package com.cuit.mapper;

import com.cuit.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface LoginUserMapper {

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    @Select("select * from user where username = #{username} and password = #{password}")
    User login(@Param("username") String username, @Param("password") String password);

    /**
     * 注册
     * @param username
     * @param password
     * @return
     */
    @Insert("insert into user(username,password) values(#{username},#{password})")
    void register(@Param("username") String username, @Param("password") String password);

}
